home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1993-03-30 | 10.8 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Tue Mar 30 15:47:00 1993, modified Tue Mar 30 15:47:00 1993, creator Think C, type ASCII, 10278 bytes "VideoTFB.c" , at 0x28a6 428 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 56 69 64 65 6f 54 | 46 42 2e 63 00 00 00 00 |..VideoT|FB.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 28 26 00 | 00 01 ac a7 de 62 44 a7 |.....(&.|.....bD.|
|00000060| de 62 44 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.bD.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 3d a3 00 00 |........|....=...|
|00000080| 2f 2a 20 56 69 64 65 6f | 54 46 42 2e 63 0d 56 69 |/* Video|TFB.c.Vi|
|00000090| 64 65 6f 54 46 42 2e 63 | 20 61 6c 6c 6f 77 73 20 |deoTFB.c| allows |
|000000a0| 64 69 72 65 63 74 20 63 | 6f 6e 74 72 6f 6c 20 6f |direct c|ontrol o|
|000000b0| 66 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 41 |f the or|iginal A|
|000000c0| 70 70 6c 65 20 63 6f 6c | 6f 72 20 76 69 64 65 6f |pple col|or video|
|000000d0| 20 63 61 72 64 73 2c 20 | 77 68 69 63 68 0d 61 72 | cards, |which.ar|
|000000e0| 65 20 6e 6f 20 6c 6f 6e | 67 65 72 20 73 6f 6c 64 |e no lon|ger sold|
|000000f0| 20 62 79 20 41 70 70 6c | 65 20 62 75 74 20 61 72 | by Appl|e but ar|
|00000100| 65 20 61 76 61 69 6c 61 | 62 6c 65 20 66 6f 72 20 |e availa|ble for |
|00000110| 24 39 30 20 66 72 6f 6d | 20 53 68 72 65 76 65 20 |$90 from| Shreve |
|00000120| 53 79 73 74 65 6d 73 0d | 28 38 30 30 2d 32 32 37 |Systems.|(800-227|
|00000130| 2d 33 39 37 31 29 2e 20 | 54 68 65 20 72 65 71 75 |-3971). |The requ|
|00000140| 69 72 65 64 20 76 69 64 | 65 6f 20 63 61 72 64 20 |ired vid|eo card |
|00000150| 66 6f 72 20 56 69 64 65 | 6f 54 46 42 20 69 73 20 |for Vide|oTFB is |
|00000160| 63 61 6c 6c 65 64 20 65 | 69 74 68 65 72 20 22 54 |called e|ither "T|
|00000170| 6f 62 79 0d 66 72 61 6d | 65 20 62 75 66 66 65 72 |oby.fram|e buffer|
|00000180| 20 63 61 72 64 22 20 6f | 72 20 22 4d 61 63 20 49 | card" o|r "Mac I|
|00000190| 49 20 48 69 67 68 2d 52 | 65 73 6f 6c 75 74 69 6f |I High-R|esolutio|
|000001a0| 6e 20 56 69 64 65 6f 20 | 43 61 72 64 22 2e 20 44 |n Video |Card". D|
|000001b0| 6f 6e d5 74 20 75 73 65 | 20 74 68 65 73 65 0d 72 |on.t use| these.r|
|000001c0| 6f 75 74 69 6e 65 73 20 | 75 6e 6c 65 73 73 20 79 |outines |unless y|
|000001d0| 6f 75 d5 72 65 20 70 72 | 65 70 61 72 65 64 20 74 |ou.re pr|epared t|
|000001e0| 6f 20 64 65 61 6c 20 77 | 69 74 68 20 74 68 65 20 |o deal w|ith the |
|000001f0| 72 65 73 75 6c 74 69 6e | 67 20 68 61 72 64 77 61 |resultin|g hardwa|
|00000200| 72 65 0d 64 65 70 65 6e | 64 65 6e 63 69 65 73 2e |re.depen|dencies.|
|00000210| 20 54 72 79 20 74 68 65 | 20 64 65 6d 6f 20 53 63 | Try the| demo Sc|
|00000220| 72 6f 6c 6c 44 65 6d 6f | 2e 0d 0d 4d 6f 73 74 20 |rollDemo|...Most |
|00000230| 70 65 6f 70 6c 65 20 73 | 68 6f 75 6c 64 20 73 6b |people s|hould sk|
|00000240| 69 70 20 74 68 69 73 20 | 66 69 6c 65 20 61 6e 64 |ip this |file and|
|00000250| 20 67 6f 20 74 6f 20 47 | 44 56 69 64 65 6f 2e 63 | go to G|DVideo.c|
|00000260| 20 69 6e 73 74 65 61 64 | 2c 20 73 69 6e 63 65 20 | instead|, since |
|00000270| 74 68 6f 73 65 0d 72 6f | 75 74 69 6e 65 73 20 77 |those.ro|utines w|
|00000280| 69 6c 6c 20 77 6f 72 6b | 20 77 69 74 68 20 41 4c |ill work| with AL|
|00000290| 4c 20 4d 61 63 20 76 69 | 64 65 6f 20 63 61 72 64 |L Mac vi|deo card|
|000002a0| 73 2e 0d 0d 54 46 42 20 | 73 74 61 6e 64 73 20 66 |s...TFB |stands f|
|000002b0| 6f 72 20 22 54 6f 62 79 | 20 46 61 72 72 61 6e 64 |or "Toby| Farrand|
|000002c0| 20 62 6f 61 72 64 22 2e | 20 54 6f 62 79 20 46 61 | board".| Toby Fa|
|000002d0| 72 72 61 6e 64 20 69 73 | 20 74 68 65 20 67 75 79 |rrand is| the guy|
|000002e0| 20 61 74 20 41 70 70 6c | 65 20 74 68 61 74 20 77 | at Appl|e that w|
|000002f0| 72 6f 74 65 0d 74 68 65 | 20 76 69 64 65 6f 20 64 |rote.the| video d|
|00000300| 72 69 76 65 72 20 66 6f | 72 20 74 68 69 73 20 63 |river fo|r this c|
|00000310| 61 72 64 2e 0d 0d 49 20 | 77 72 6f 74 65 20 74 68 |ard...I |wrote th|
|00000320| 69 73 20 62 61 73 65 64 | 20 6f 6e 20 6d 79 20 64 |is based| on my d|
|00000330| 69 73 61 73 73 65 6d 62 | 6c 79 20 6f 66 20 74 68 |isassemb|ly of th|
|00000340| 65 20 41 70 70 6c 65 20 | 76 69 64 65 6f 20 64 72 |e Apple |video dr|
|00000350| 69 76 65 72 20 61 6e 64 | 20 74 68 65 20 6d 65 6d |iver and| the mem|
|00000360| 6f 72 79 0d 64 69 61 67 | 6e 6f 73 74 69 63 73 20 |ory.diag|nostics |
|00000370| 49 20 72 65 63 65 69 76 | 65 64 20 66 72 6f 6d 20 |I receiv|ed from |
|00000380| 54 6f 62 79 20 46 61 72 | 72 61 6e 64 2e 0d 0d 48 |Toby Far|rand...H|
|00000390| 49 53 54 4f 52 59 3a 0d | 31 30 2f 32 39 2f 38 38 |ISTORY:.|10/29/88|
|000003a0| 09 64 67 70 09 77 72 6f | 74 65 20 69 74 0d 31 32 |.dgp.wro|te it.12|
|000003b0| 2f 35 2f 38 39 09 09 64 | 67 70 09 74 69 64 69 65 |/5/89..d|gp.tidie|
|000003c0| 64 20 69 74 20 75 70 20 | 61 20 62 69 74 2e 20 44 |d it up |a bit. D|
|000003d0| 65 6c 65 74 65 64 20 74 | 77 6f 20 6f 62 73 6f 6c |eleted t|wo obsol|
|000003e0| 65 74 65 20 72 6f 75 74 | 69 6e 65 73 2e 0d 33 2f |ete rout|ines..3/|
|000003f0| 32 30 2f 39 30 09 09 64 | 67 70 09 6d 61 6b 65 20 |20/90..d|gp.make |
|00000400| 63 6f 6d 70 61 74 69 62 | 6c 65 20 77 69 74 68 20 |compatib|le with |
|00000410| 4d 50 57 20 43 2e 0d 33 | 2f 32 33 2f 39 30 09 09 |MPW C..3|/23/90..|
|00000420| 64 67 70 20 69 6e 73 65 | 72 74 65 64 20 61 20 74 |dgp inse|rted a t|
|00000430| 65 73 74 20 69 6e 20 65 | 76 65 72 79 20 72 6f 75 |est in e|very rou|
|00000440| 74 69 6e 65 20 74 6f 20 | 65 78 69 74 20 75 6e 6c |tine to |exit unl|
|00000450| 65 73 73 20 69 74 27 73 | 20 61 20 54 46 42 20 63 |ess it's| a TFB c|
|00000460| 61 72 64 2e 0d 38 2f 32 | 34 2f 39 31 09 09 64 67 |ard..8/2|4/91..dg|
|00000470| 70 09 4d 61 64 65 20 63 | 6f 6d 70 61 74 69 62 6c |p.Made c|ompatibl|
|00000480| 65 20 77 69 74 68 20 54 | 48 49 4e 4b 20 43 20 35 |e with T|HINK C 5|
|00000490| 2e 30 2e 0d 31 32 2f 31 | 37 2f 39 32 09 64 67 70 |.0..12/1|7/92.dgp|
|000004a0| 20 61 64 64 65 64 20 63 | 61 63 68 65 20 74 6f 20 | added c|ache to |
|000004b0| 73 70 65 65 64 20 75 70 | 20 54 46 42 49 6e 53 6c |speed up| TFBInSl|
|000004c0| 6f 74 2e 0d 2a 2f 0d 23 | 69 6e 63 6c 75 64 65 20 |ot..*/.#|include |
|000004d0| 22 56 69 64 65 6f 54 6f | 6f 6c 62 6f 78 2e 68 22 |"VideoTo|olbox.h"|
|000004e0| 0d 0d 2f 2a 20 54 68 65 | 20 43 61 72 64 42 61 73 |../* The| CardBas|
|000004f0| 65 20 61 64 64 72 65 73 | 73 20 64 65 70 65 6e 64 |e addres|s depend|
|00000500| 73 20 6f 6e 20 77 68 69 | 63 68 20 73 6c 6f 74 20 |s on whi|ch slot |
|00000510| 74 68 65 20 63 61 72 64 | 20 69 73 20 70 6c 75 67 |the card| is plug|
|00000520| 67 65 64 20 69 6e 74 6f | 20 2a 2f 0d 2f 2a 20 49 |ged into| */./* I|
|00000530| 66 20 74 68 65 20 63 61 | 72 64 20 69 73 20 70 6c |f the ca|rd is pl|
|00000540| 75 67 67 65 64 20 69 6e | 74 6f 20 74 68 65 20 66 |ugged in|to the f|
|00000550| 69 72 73 74 20 73 6c 6f | 74 2c 20 69 2e 65 2e 20 |irst slo|t, i.e. |
|00000560| 73 6c 6f 74 20 39 2c 20 | 74 68 65 6e 20 2a 2f 0d |slot 9, |then */.|
|00000570| 2f 2a 20 74 68 65 20 61 | 64 64 72 65 73 73 20 69 |/* the a|ddress i|
|00000580| 73 20 30 78 46 39 39 30 | 30 30 30 30 2e 20 54 68 |s 0xF990|0000. Th|
|00000590| 65 20 73 6c 6f 74 73 20 | 61 72 65 20 6e 75 6d 62 |e slots |are numb|
|000005a0| 65 72 65 64 20 39 20 74 | 6f 20 46 2c 20 77 69 74 |ered 9 t|o F, wit|
|000005b0| 68 20 61 64 64 72 65 73 | 73 65 73 20 2a 2f 0d 2f |h addres|ses */./|
|000005c0| 2a 20 30 78 46 39 39 30 | 30 30 30 30 20 74 6f 20 |* 0xF990|0000 to |
|000005d0| 30 78 46 46 46 30 30 30 | 30 30 2e 20 54 68 65 20 |0xFFF000|00. The |
|000005e0| 73 6c 6f 74 20 6e 75 6d | 62 65 72 20 61 70 70 65 |slot num|ber appe|
|000005f0| 61 72 73 20 74 77 69 63 | 65 20 69 6e 20 74 68 65 |ars twic|e in the|
|00000600| 20 61 64 64 72 65 73 73 | 20 2a 2f 0d 2f 2a 20 69 | address| */./* i|
|00000610| 6e 20 6f 72 64 65 72 20 | 74 6f 20 62 65 20 63 6f |n order |to be co|
|00000620| 6d 70 61 74 69 62 6c 65 | 20 77 69 74 68 20 4d 61 |mpatible| with Ma|
|00000630| 63 20 49 49 27 73 20 73 | 75 70 70 6f 72 74 69 6e |c II's s|upportin|
|00000640| 67 20 65 69 74 68 65 72 | 20 32 34 20 6f 72 20 33 |g either| 24 or 3|
|00000650| 32 20 62 69 74 20 2a 2f | 0d 2f 2a 20 61 64 64 72 |2 bit */|./* addr|
|00000660| 65 73 73 69 6e 67 2e 20 | 54 68 65 20 6d 61 63 72 |essing. |The macr|
|00000670| 6f 20 43 41 52 44 42 41 | 53 45 28 73 6c 6f 74 29 |o CARDBA|SE(slot)|
|00000680| 20 67 65 6e 65 72 61 74 | 65 73 20 74 68 65 20 70 | generat|es the p|
|00000690| 72 6f 70 65 72 20 61 64 | 64 72 65 73 73 2e 20 2a |roper ad|dress. *|
|000006a0| 2f 0d 0d 23 64 65 66 69 | 6e 65 20 43 41 52 44 42 |/..#defi|ne CARDB|
|000006b0| 41 53 45 28 73 6c 6f 74 | 29 20 28 75 6e 73 69 67 |ASE(slot|) (unsig|
|000006c0| 6e 65 64 20 63 68 61 72 | 20 2a 29 28 30 78 46 30 |ned char| *)(0xF0|
|000006d0| 30 30 30 30 30 30 2b 30 | 78 30 31 31 30 30 30 30 |000000+0|x0110000|
|000006e0| 30 2a 73 6c 6f 74 29 0d | 23 64 65 66 69 6e 65 20 |0*slot).|#define |
|000006f0| 56 69 64 65 6f 42 61 73 | 65 28 73 6c 6f 74 29 20 |VideoBas|e(slot) |
|00000700| 28 75 6e 73 69 67 6e 65 | 64 20 63 68 61 72 20 2a |(unsigne|d char *|
|00000710| 29 28 30 78 46 30 30 30 | 30 30 32 30 2b 30 78 30 |)(0xF000|0020+0x0|
|00000720| 31 31 30 30 30 30 30 2a | 73 6c 6f 74 29 0d 23 64 |1100000*|slot).#d|
|00000730| 65 66 69 6e 65 09 54 46 | 42 42 61 73 65 09 09 30 |efine.TF|BBase..0|
|00000740| 78 38 30 30 30 30 0d 23 | 64 65 66 69 6e 65 20 54 |x80000.#|define T|
|00000750| 46 42 50 61 6e 09 09 30 | 78 38 30 30 30 43 0d 23 |FBPan..0|x8000C.#|
|00000760| 64 65 66 69 6e 65 09 54 | 46 42 49 42 61 73 65 09 |define.T|FBIBase.|
|00000770| 30 78 38 66 66 66 63 0d | 23 64 65 66 69 6e 65 20 |0x8fffc.|#define |
|00000780| 43 6c 75 74 44 61 74 61 | 52 65 67 09 30 78 39 30 |ClutData|Reg.0x90|
|00000790| 30 31 38 0d 23 64 65 66 | 69 6e 65 20 43 6c 75 74 |018.#def|ine Clut|
|000007a0| 41 64 64 72 52 65 67 09 | 30 78 39 30 30 31 43 0d |AddrReg.|0x9001C.|
|000007b0| 23 64 65 66 69 6e 65 09 | 52 65 61 64 56 53 79 6e |#define.|ReadVSyn|
|000007c0| 63 09 30 78 44 30 30 30 | 30 0d 23 64 65 66 69 6e |c.0xD000|0.#defin|
|000007d0| 65 09 52 65 61 64 56 49 | 6e 74 09 30 78 44 30 30 |e.ReadVI|nt.0xD00|
|000007e0| 30 34 0d 23 64 65 66 69 | 6e 65 09 52 65 61 64 49 |04.#defi|ne.ReadI|
|000007f0| 6e 74 6c 63 09 30 78 44 | 30 30 30 38 0d 23 64 65 |ntlc.0xD|0008.#de|
|00000800| 66 69 6e 65 09 56 49 6e | 74 45 6e 61 62 6c 65 09 |fine.VIn|tEnable.|
|00000810| 30 78 41 30 30 30 30 0d | 23 64 65 66 69 6e 65 09 |0xA0000.|#define.|
|00000820| 56 49 6e 74 44 69 73 61 | 62 6c 65 09 30 78 41 30 |VIntDisa|ble.0xA0|
|00000830| 30 30 34 0d 23 64 65 66 | 69 6e 65 20 47 45 4e 4c |004.#def|ine GENL|
|00000840| 4f 43 4b 09 09 38 0d 23 | 64 65 66 69 6e 65 09 47 |OCK..8.#|define.G|
|00000850| 45 4e 4c 4f 43 4b 52 45 | 47 09 31 0d 0d 75 6e 73 |ENLOCKRE|G.1..uns|
|00000860| 69 67 6e 65 64 20 63 68 | 61 72 20 54 46 42 52 65 |igned ch|ar TFBRe|
|00000870| 67 69 73 74 65 72 56 61 | 6c 75 65 73 5b 34 5d 5b |gisterVa|lues[4][|
|00000880| 31 36 5d 20 3d 20 7b 0d | 09 7b 33 32 2c 37 31 2c |16] = {.|.{32,71,|
|00000890| 30 2c 38 2c 33 30 2c 32 | 32 39 2c 31 31 39 2c 37 |0,8,30,2|29,119,7|
|000008a0| 30 2c 35 2c 32 2c 32 2c | 31 2c 31 35 2c 36 35 2c |0,5,2,2,|1,15,65,|
|000008b0| 35 2c 32 30 30 7d 2c 09 | 09 09 2f 2a 20 31 20 62 |5,200},.|../* 1 b|
|000008c0| 69 74 2f 70 69 78 65 6c | 20 2a 2f 0d 09 7b 36 34 |it/pixel| */..{64|
|000008d0| 2c 37 31 2c 30 2c 38 2c | 36 30 2c 32 32 39 2c 31 |,71,0,8,|60,229,1|
|000008e0| 31 39 2c 37 30 2c 35 2c | 36 2c 36 2c 34 2c 33 32 |19,70,5,|6,6,4,32|
|000008f0| 2c 34 2c 31 31 2c 32 31 | 36 7d 2c 09 09 09 2f 2a |,4,11,21|6},.../*|
|00000900| 20 32 20 62 69 74 2f 70 | 69 78 65 6c 20 2a 2f 0d | 2 bit/p|ixel */.|
|00000910| 09 7b 31 32 38 2c 37 31 | 2c 30 2c 38 2c 31 32 30 |.{128,71|,0,8,120|
|00000920| 2c 32 32 39 2c 31 31 39 | 2c 37 30 2c 35 2c 31 34 |,229,119|,70,5,14|
|00000930| 2c 31 34 2c 31 30 2c 36 | 36 2c 2d 31 31 38 2c 32 |,14,10,6|6,-118,2|
|00000940| 32 2c 2d 32 34 7d 2c 09 | 2f 2a 20 34 20 62 69 74 |2,-24},.|/* 4 bit|
|00000950| 2f 70 69 78 65 6c 20 2a | 2f 0d 09 7b 30 2c 37 31 |/pixel *|/..{0,71|
|00000960| 2c 30 2c 38 2c 32 34 30 | 2c 32 32 39 2c 31 31 39 |,0,8,240|,229,119|
|00000970| 2c 37 30 2c 35 2c 33 30 | 2c 33 30 2c 32 32 2c 31 |,70,5,30|,30,22,1|
|00000980| 33 34 2c 31 35 30 2c 34 | 35 2c 32 34 39 7d 09 09 |34,150,4|5,249}..|
|00000990| 2f 2a 20 38 20 62 69 74 | 2f 70 69 78 65 6c 20 2a |/* 8 bit|/pixel *|
|000009a0| 2f 0d 7d 3b 0d 0d 75 6e | 73 69 67 6e 65 64 20 63 |/.};..un|signed c|
|000009b0| 68 61 72 20 4e 74 73 63 | 56 61 6c 75 65 73 5b 31 |har Ntsc|Values[1|
|000009c0| 36 5d 20 3d 0d 09 7b 30 | 2c 31 38 33 2c 30 2c 38 |6] =..{0|,183,0,8|
|000009d0| 2c 39 36 2c 32 32 39 2c | 35 39 2c 32 35 2c 35 2c |,96,229,|59,25,5,|
|000009e0| 38 2c 32 36 2c 31 34 2c | 31 33 32 2c 31 34 2c 34 |8,26,14,|132,14,4|
|000009f0| 36 2c 32 34 39 7d 3b 09 | 09 2f 2a 20 66 72 6f 6d |6,249};.|./* from|
|00000a00| 20 4e 74 73 63 46 6b 65 | 79 20 2a 2f 0d 0d 0d 42 | NtscFke|y */...B|
|00000a10| 6f 6f 6c 65 61 6e 20 54 | 46 42 49 6e 53 6c 6f 74 |oolean T|FBInSlot|
|00000a20| 28 69 6e 74 20 73 6c 6f | 74 29 0d 7b 0d 09 47 44 |(int slo|t).{..GD|
|00000a30| 48 61 6e 64 6c 65 20 64 | 65 76 69 63 65 3b 0d 09 |Handle d|evice;..|
|00000a40| 73 74 61 74 69 63 20 42 | 6f 6f 6c 65 61 6e 20 74 |static B|oolean t|
|00000a50| 65 73 74 65 64 5b 31 36 | 5d 3d 7b 30 2c 30 2c 30 |ested[16|]={0,0,0|
|00000a60| 2c 30 2c 30 2c 30 2c 30 | 2c 30 2c 30 2c 30 2c 30 |,0,0,0,0|,0,0,0,0|
|00000a70| 2c 30 2c 30 2c 30 2c 30 | 2c 30 7d 3b 0d 09 73 74 |,0,0,0,0|,0};..st|
|00000a80| 61 74 69 63 20 42 6f 6f | 6c 65 61 6e 20 6f 6b 5b |atic Boo|lean ok[|
|00000a90| 31 36 5d 3b 0d 09 0d 09 | 69 66 28 73 6c 6f 74 3e |16];....|if(slot>|
|00000aa0| 31 35 29 72 65 74 75 72 | 6e 20 30 3b 0d 09 69 66 |15)retur|n 0;..if|
|00000ab0| 28 21 74 65 73 74 65 64 | 5b 73 6c 6f 74 5d 29 7b |(!tested|[slot]){|
|00000ac0| 0d 09 09 74 65 73 74 65 | 64 5b 73 6c 6f 74 5d 3d |...teste|d[slot]=|
|00000ad0| 31 3b 0d 09 09 64 65 76 | 69 63 65 3d 53 6c 6f 74 |1;...dev|ice=Slot|
|00000ae0| 54 6f 53 63 72 65 65 6e | 44 65 76 69 63 65 28 73 |ToScreen|Device(s|
|00000af0| 6c 6f 74 29 3b 0d 09 09 | 6f 6b 5b 73 6c 6f 74 5d |lot);...|ok[slot]|
|00000b00| 3d 45 71 75 61 6c 53 74 | 72 69 6e 67 28 22 5c 70 |=EqualSt|ring("\p|
|00000b10| 2e 44 69 73 70 6c 61 79 | 5f 56 69 64 65 6f 5f 41 |.Display|_Video_A|
|00000b20| 70 70 6c 65 5f 54 46 42 | 22 2c 47 44 4e 61 6d 65 |pple_TFB|",GDName|
|00000b30| 28 64 65 76 69 63 65 29 | 2c 31 2c 31 29 3b 0d 09 |(device)|,1,1);..|
|00000b40| 7d 0d 09 72 65 74 75 72 | 6e 20 6f 6b 5b 73 6c 6f |}..retur|n ok[slo|
|00000b50| 74 5d 3b 0d 7d 0d 0d 76 | 6f 69 64 20 53 65 74 55 |t];.}..v|oid SetU|
|00000b60| 70 54 46 42 28 69 6e 74 | 20 73 6c 6f 74 29 0d 7b |pTFB(int| slot).{|
|00000b70| 0d 09 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 |..regist|er unsig|
|00000b80| 6e 65 64 20 63 68 61 72 | 20 2a 64 73 74 50 74 72 |ned char| *dstPtr|
|00000b90| 42 2c 2a 73 72 63 50 74 | 72 42 3b 0d 09 72 65 67 |B,*srcPt|rB;..reg|
|00000ba0| 69 73 74 65 72 20 6c 6f | 6e 67 20 69 6e 74 20 69 |ister lo|ng int i|
|00000bb0| 3b 0d 0d 09 69 66 28 21 | 54 46 42 49 6e 53 6c 6f |;...if(!|TFBInSlo|
|00000bc0| 74 28 73 6c 6f 74 29 29 | 7b 0d 09 09 70 72 69 6e |t(slot))|{...prin|
|00000bd0| 74 66 28 22 54 68 65 20 | 63 61 72 64 20 69 6e 20 |tf("The |card in |
|00000be0| 73 6c 6f 74 20 25 64 20 | 69 73 20 6e 6f 74 20 61 |slot %d |is not a|
|00000bf0| 20 54 46 42 20 63 61 72 | 64 21 5c 6e 22 2c 73 6c | TFB car|d!\n",sl|
|00000c00| 6f 74 29 3b 0d 09 09 72 | 65 74 75 72 6e 3b 0d 09 |ot);...r|eturn;..|
|00000c10| 7d 0d 09 64 73 74 50 74 | 72 42 20 3d 20 43 41 52 |}..dstPt|rB = CAR|
|00000c20| 44 42 41 53 45 28 73 6c | 6f 74 29 20 2b 20 54 46 |DBASE(sl|ot) + TF|
|00000c30| 42 49 42 61 73 65 3b 0d | 09 73 72 63 50 74 72 42 |BIBase;.|.srcPtrB|
|00000c40| 20 3d 20 26 54 46 42 52 | 65 67 69 73 74 65 72 56 | = &TFBR|egisterV|
|00000c50| 61 6c 75 65 73 5b 30 5d | 5b 30 5d 3b 0d 09 66 6f |alues[0]|[0];..fo|
|00000c60| 72 20 28 69 3d 31 35 3b | 20 69 3e 3d 30 3b 20 69 |r (i=15;| i>=0; i|
|00000c70| 2d 2d 29 20 7b 0d 09 09 | 2a 64 73 74 50 74 72 42 |--) {...|*dstPtrB|
|00000c80| 20 3d 20 7e 2a 73 72 63 | 50 74 72 42 2b 2b 3b 0d | = ~*src|PtrB++;.|
|00000c90| 09 09 64 73 74 50 74 72 | 42 20 2d 3d 20 34 3b 0d |..dstPtr|B -= 4;.|
|00000ca0| 09 7d 0d 7d 0d 0d 76 6f | 69 64 20 52 61 6d 70 43 |.}.}..vo|id RampC|
|00000cb0| 6c 75 74 54 46 42 28 69 | 6e 74 20 73 6c 6f 74 29 |lutTFB(i|nt slot)|
|00000cc0| 0d 2f 2a 20 6c 6f 61 64 | 73 20 74 68 65 20 63 6c |./* load|s the cl|
|00000cd0| 75 74 20 77 69 74 68 20 | 61 6e 20 69 64 65 6e 74 |ut with |an ident|
|00000ce0| 69 63 61 6c 20 6c 69 6e | 65 61 72 20 72 61 6d 70 |ical lin|ear ramp|
|00000cf0| 20 69 6e 20 52 2c 20 47 | 2c 20 61 6e 64 20 42 2e | in R, G|, and B.|
|00000d00| 20 2a 2f 0d 7b 0d 09 72 | 65 67 69 73 74 65 72 20 | */.{..r|egister |
|00000d10| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 64 |unsigned| char *d|
|00000d20| 73 74 50 74 72 42 3b 0d | 09 72 65 67 69 73 74 65 |stPtrB;.|.registe|
|00000d30| 72 20 69 6e 74 20 69 3b | 0d 0d 09 69 66 28 21 54 |r int i;|...if(!T|
|00000d40| 46 42 49 6e 53 6c 6f 74 | 28 73 6c 6f 74 29 29 7b |FBInSlot|(slot)){|
|00000d50| 0d 09 09 70 72 69 6e 74 | 66 28 22 54 68 65 20 63 |...print|f("The c|
|00000d60| 61 72 64 20 69 6e 20 73 | 6c 6f 74 20 25 64 20 69 |ard in s|lot %d i|
|00000d70| 73 20 6e 6f 74 20 61 20 | 54 46 42 20 63 61 72 64 |s not a |TFB card|
|00000d80| 21 5c 6e 22 2c 73 6c 6f | 74 29 3b 0d 09 09 72 65 |!\n",slo|t);...re|
|00000d90| 74 75 72 6e 3b 0d 09 7d | 0d 09 2a 28 43 41 52 44 |turn;..}|..*(CARD|
|00000da0| 42 41 53 45 28 73 6c 6f | 74 29 20 2b 20 43 6c 75 |BASE(slo|t) + Clu|
|00000db0| 74 41 64 64 72 52 65 67 | 29 20 3d 20 32 35 35 3b |tAddrReg|) = 255;|
|00000dc0| 0d 09 64 73 74 50 74 72 | 42 20 3d 20 43 41 52 44 |..dstPtr|B = CARD|
|00000dd0| 42 41 53 45 28 73 6c 6f | 74 29 20 2b 20 43 6c 75 |BASE(slo|t) + Clu|
|00000de0| 74 44 61 74 61 52 65 67 | 3b 0d 09 66 6f 72 20 28 |tDataReg|;..for (|
|00000df0| 69 3d 32 35 35 3b 20 69 | 20 3e 3d 20 30 3b 20 69 |i=255; i| >= 0; i|
|00000e00| 2d 2d 29 7b 0d 09 09 2a | 64 73 74 50 74 72 42 20 |--){...*|dstPtrB |
|00000e10| 3d 20 2a 64 73 74 50 74 | 72 42 20 3d 20 2a 64 73 |= *dstPt|rB = *ds|
|00000e20| 74 50 74 72 42 20 3d 20 | 28 75 6e 73 69 67 6e 65 |tPtrB = |(unsigne|
|00000e30| 64 20 63 68 61 72 29 20 | 69 3b 0d 09 7d 0d 09 72 |d char) |i;..}..r|
|00000e40| 65 74 75 72 6e 3b 0d 7d | 0d 0d 76 6f 69 64 20 47 |eturn;.}|..void G|
|00000e50| 72 61 79 43 6c 75 74 54 | 46 42 28 69 6e 74 20 73 |rayClutT|FB(int s|
|00000e60| 6c 6f 74 29 0d 2f 2a 20 | 6c 6f 61 64 73 20 74 68 |lot)./* |loads th|
|00000e70| 65 20 65 6e 74 69 72 65 | 20 63 6c 75 74 20 77 69 |e entire| clut wi|
|00000e80| 74 68 20 75 6e 69 66 6f | 72 6d 20 67 72 61 79 2e |th unifo|rm gray.|
|00000e90| 20 2a 2f 0d 7b 0d 09 72 | 65 67 69 73 74 65 72 20 | */.{..r|egister |
|00000ea0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 64 |unsigned| char *d|
|00000eb0| 73 74 50 74 72 42 3b 0d | 09 72 65 67 69 73 74 65 |stPtrB;.|.registe|
|00000ec0| 72 20 69 6e 74 20 69 3b | 0d 0d 09 69 66 28 21 54 |r int i;|...if(!T|
|00000ed0| 46 42 49 6e 53 6c 6f 74 | 28 73 6c 6f 74 29 29 7b |FBInSlot|(slot)){|
|00000ee0| 0d 09 09 70 72 69 6e 74 | 66 28 22 54 68 65 20 63 |...print|f("The c|
|00000ef0| 61 72 64 20 69 6e 20 73 | 6c 6f 74 20 25 64 20 69 |ard in s|lot %d i|
|00000f00| 73 20 6e 6f 74 20 61 20 | 54 46 42 20 63 61 72 64 |s not a |TFB card|
|00000f10| 21 5c 6e 22 2c 73 6c 6f | 74 29 3b 0d 09 09 72 65 |!\n",slo|t);...re|
|00000f20| 74 75 72 6e 3b 0d 09 7d | 0d 09 2a 28 43 41 52 44 |turn;..}|..*(CARD|
|00000f30| 42 41 53 45 28 73 6c 6f | 74 29 20 2b 20 43 6c 75 |BASE(slo|t) + Clu|
|00000f40| 74 41 64 64 72 52 65 67 | 29 20 3d 20 32 35 35 3b |tAddrReg|) = 255;|
|00000f50| 0d 09 64 73 74 50 74 72 | 42 20 3d 20 43 41 52 44 |..dstPtr|B = CARD|
|00000f60| 42 41 53 45 28 73 6c 6f | 74 29 20 2b 20 43 6c 75 |BASE(slo|t) + Clu|
|00000f70| 74 44 61 74 61 52 65 67 | 3b 0d 09 2a 64 73 74 50 |tDataReg|;..*dstP|
|00000f80| 74 72 42 20 3d 20 2a 64 | 73 74 50 74 72 42 20 3d |trB = *d|stPtrB =|
|00000f90| 20 2a 64 73 74 50 74 72 | 42 20 3d 20 28 75 6e 73 | *dstPtr|B = (uns|
|00000fa0| 69 67 6e 65 64 20 63 68 | 61 72 29 20 32 35 35 3b |igned ch|ar) 255;|
|00000fb0| 0d 09 66 6f 72 20 28 69 | 3d 32 35 34 3b 20 69 20 |..for (i|=254; i |
|00000fc0| 3e 3d 20 31 3b 20 69 2d | 2d 29 7b 0d 09 09 2a 64 |>= 1; i-|-){...*d|
|00000fd0| 73 74 50 74 72 42 20 3d | 20 2a 64 73 74 50 74 72 |stPtrB =| *dstPtr|
|00000fe0| 42 20 3d 20 2a 64 73 74 | 50 74 72 42 20 3d 20 28 |B = *dst|PtrB = (|
|00000ff0| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 29 20 31 |unsigned| char) 1|
|00001000| 32 37 3b 0d 09 7d 0d 09 | 2a 64 73 74 50 74 72 42 |27;..}..|*dstPtrB|
|00001010| 20 3d 20 2a 64 73 74 50 | 74 72 42 20 3d 20 2a 64 | = *dstP|trB = *d|
|00001020| 73 74 50 74 72 42 20 3d | 20 28 75 6e 73 69 67 6e |stPtrB =| (unsign|
|00001030| 65 64 20 63 68 61 72 29 | 20 30 3b 0d 09 72 65 74 |ed char)| 0;..ret|
|00001040| 75 72 6e 3b 0d 7d 0d 0d | 76 6f 69 64 20 4c 6f 61 |urn;.}..|void Loa|
|00001050| 64 43 6c 75 74 54 46 42 | 28 69 6e 74 20 73 6c 6f |dClutTFB|(int slo|
|00001060| 74 2c 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 20 |t,unsign|ed char |
|00001070| 72 67 62 5b 32 35 36 5d | 5b 33 5d 29 0d 2f 2a 20 |rgb[256]|[3])./* |
|00001080| 6c 6f 61 64 73 20 74 68 | 65 20 63 6c 75 74 20 77 |loads th|e clut w|
|00001090| 69 74 68 20 61 20 75 73 | 65 72 2d 73 75 70 70 6c |ith a us|er-suppl|
|000010a0| 69 65 64 20 61 72 72 61 | 79 2e 20 2a 2f 0d 7b 0d |ied arra|y. */.{.|
|000010b0| 09 72 65 67 69 73 74 65 | 72 20 75 6e 73 69 67 6e |.registe|r unsign|
|000010c0| 65 64 20 63 68 61 72 20 | 2a 73 72 63 50 74 72 42 |ed char |*srcPtrB|
|000010d0| 2c 2a 64 73 74 50 74 72 | 42 3b 0d 09 72 65 67 69 |,*dstPtr|B;..regi|
|000010e0| 73 74 65 72 20 69 6e 74 | 20 69 3b 0d 0d 0d 09 69 |ster int| i;....i|
|000010f0| 66 28 21 54 46 42 49 6e | 53 6c 6f 74 28 73 6c 6f |f(!TFBIn|Slot(slo|
|00001100| 74 29 29 7b 0d 09 09 70 | 72 69 6e 74 66 28 22 54 |t)){...p|rintf("T|
|00001110| 68 65 20 63 61 72 64 20 | 69 6e 20 73 6c 6f 74 20 |he card |in slot |
|00001120| 25 64 20 69 73 20 6e 6f | 74 20 61 20 54 46 42 20 |%d is no|t a TFB |
|00001130| 63 61 72 64 21 5c 6e 22 | 2c 73 6c 6f 74 29 3b 0d |card!\n"|,slot);.|
|00001140| 09 09 72 65 74 75 72 6e | 3b 0d 09 7d 0d 09 2a 28 |..return|;..}..*(|
|00001150| 43 41 52 44 42 41 53 45 | 28 73 6c 6f 74 29 20 2b |CARDBASE|(slot) +|
|00001160| 20 43 6c 75 74 41 64 64 | 72 52 65 67 29 20 3d 20 | ClutAdd|rReg) = |
|00001170| 32 35 35 3b 0d 09 64 73 | 74 50 74 72 42 20 3d 20 |255;..ds|tPtrB = |
|00001180| 43 41 52 44 42 41 53 45 | 28 73 6c 6f 74 29 20 2b |CARDBASE|(slot) +|
|00001190| 20 43 6c 75 74 44 61 74 | 61 52 65 67 3b 0d 09 73 | ClutDat|aReg;..s|
|000011a0| 72 63 50 74 72 42 20 3d | 20 26 72 67 62 5b 32 35 |rcPtrB =| &rgb[25|
|000011b0| 35 5d 5b 32 5d 3b 0d 09 | 73 72 63 50 74 72 42 2b |5][2];..|srcPtrB+|
|000011c0| 2b 3b 0d 09 66 6f 72 20 | 28 69 3d 32 35 35 2f 34 |+;..for |(i=255/4|
|000011d0| 3b 20 69 20 3e 3d 20 30 | 3b 20 69 2d 2d 29 7b 0d |; i >= 0|; i--){.|
|000011e0| 09 09 2a 64 73 74 50 74 | 72 42 20 3d 20 2a 28 2d |..*dstPt|rB = *(-|
|000011f0| 2d 73 72 63 50 74 72 42 | 29 3b 0d 09 09 2a 64 73 |-srcPtrB|);...*ds|
|00001200| 74 50 74 72 42 20 3d 20 | 2a 28 2d 2d 73 72 63 50 |tPtrB = |*(--srcP|
|00001210| 74 72 42 29 3b 0d 09 09 | 2a 64 73 74 50 74 72 42 |trB);...|*dstPtrB|
|00001220| 20 3d 20 2a 28 2d 2d 73 | 72 63 50 74 72 42 29 3b | = *(--s|rcPtrB);|
|00001230| 0d 0d 09 09 2a 64 73 74 | 50 74 72 42 20 3d 20 2a |....*dst|PtrB = *|
|00001240| 28 2d 2d 73 72 63 50 74 | 72 42 29 3b 0d 09 09 2a |(--srcPt|rB);...*|
|00001250| 64 73 74 50 74 72 42 20 | 3d 20 2a 28 2d 2d 73 72 |dstPtrB |= *(--sr|
|00001260| 63 50 74 72 42 29 3b 0d | 09 09 2a 64 73 74 50 74 |cPtrB);.|..*dstPt|
|00001270| 72 42 20 3d 20 2a 28 2d | 2d 73 72 63 50 74 72 42 |rB = *(-|-srcPtrB|
|00001280| 29 3b 0d 0d 09 09 2a 64 | 73 74 50 74 72 42 20 3d |);....*d|stPtrB =|
|00001290| 20 2a 28 2d 2d 73 72 63 | 50 74 72 42 29 3b 0d 09 | *(--src|PtrB);..|
|000012a0| 09 2a 64 73 74 50 74 72 | 42 20 3d 20 2a 28 2d 2d |.*dstPtr|B = *(--|
|000012b0| 73 72 63 50 74 72 42 29 | 3b 0d 09 09 2a 64 73 74 |srcPtrB)|;...*dst|
|000012c0| 50 74 72 42 20 3d 20 2a | 28 2d 2d 73 72 63 50 74 |PtrB = *|(--srcPt|
|000012d0| 72 42 29 3b 0d 0d 09 09 | 2a 64 73 74 50 74 72 42 |rB);....|*dstPtrB|
|000012e0| 20 3d 20 2a 28 2d 2d 73 | 72 63 50 74 72 42 29 3b | = *(--s|rcPtrB);|
|000012f0| 0d 09 09 2a 64 73 74 50 | 74 72 42 20 3d 20 2a 28 |...*dstP|trB = *(|
|00001300| 2d 2d 73 72 63 50 74 72 | 42 29 3b 0d 09 09 2a 64 |--srcPtr|B);...*d|
|00001310| 73 74 50 74 72 42 20 3d | 20 2a 28 2d 2d 73 72 63 |stPtrB =| *(--src|
|00001320| 50 74 72 42 29 3b 0d 09 | 7d 0d 09 72 65 74 75 72 |PtrB);..|}..retur|
|00001330| 6e 3b 0d 7d 0d 0d 76 6f | 69 64 20 4e 65 77 42 6c |n;.}..vo|id NewBl|
|00001340| 61 6e 6b 69 6e 67 54 46 | 42 28 69 6e 74 20 73 6c |ankingTF|B(int sl|
|00001350| 6f 74 29 0d 2f 2a 20 4e | 65 77 42 6c 61 6e 6b 69 |ot)./* N|ewBlanki|
|00001360| 6e 67 54 46 42 20 77 61 | 69 74 73 20 66 6f 72 20 |ngTFB wa|its for |
|00001370| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 20 6f 66 |the begi|nning of|
|00001380| 20 74 68 65 20 6e 65 78 | 74 20 76 65 72 74 69 63 | the nex|t vertic|
|00001390| 61 6c 20 62 6c 61 6e 6b | 69 6e 67 20 69 6e 74 65 |al blank|ing inte|
|000013a0| 72 76 61 6c 20 2a 2f 0d | 2f 2a 20 54 68 65 20 73 |rval */.|/* The s|
|000013b0| 74 61 6e 64 61 72 64 20 | 41 70 70 6c 65 20 76 69 |tandard |Apple vi|
|000013c0| 64 65 6f 20 72 61 74 65 | 20 69 73 20 36 36 2e 36 |deo rate| is 66.6|
|000013d0| 37 20 48 7a 20 2a 2f 0d | 7b 0d 09 72 65 67 69 73 |7 Hz */.|{..regis|
|000013e0| 74 65 72 20 6c 6f 6e 67 | 20 2a 62 6c 61 6e 6b 69 |ter long| *blanki|
|000013f0| 6e 67 50 74 72 3b 0d 0d | 09 69 66 28 21 54 46 42 |ngPtr;..|.if(!TFB|
|00001400| 49 6e 53 6c 6f 74 28 73 | 6c 6f 74 29 29 7b 0d 09 |InSlot(s|lot)){..|
|00001410| 09 70 72 69 6e 74 66 28 | 22 54 68 65 20 63 61 72 |.printf(|"The car|
|00001420| 64 20 69 6e 20 73 6c 6f | 74 20 25 64 20 69 73 20 |d in slo|t %d is |
|00001430| 6e 6f 74 20 61 20 54 46 | 42 20 63 61 72 64 21 5c |not a TF|B card!\|
|00001440| 6e 22 2c 73 6c 6f 74 29 | 3b 0d 09 09 72 65 74 75 |n",slot)|;...retu|
|00001450| 72 6e 3b 0d 09 7d 0d 09 | 62 6c 61 6e 6b 69 6e 67 |rn;..}..|blanking|
|00001460| 50 74 72 20 3d 20 28 6c | 6f 6e 67 20 2a 29 20 28 |Ptr = (l|ong *) (|
|00001470| 43 41 52 44 42 41 53 45 | 28 73 6c 6f 74 29 20 2b |CARDBASE|(slot) +|
|00001480| 20 52 65 61 64 56 53 79 | 6e 63 29 3b 0d 09 77 68 | ReadVSy|nc);..wh|
|00001490| 69 6c 65 20 28 2a 62 6c | 61 6e 6b 69 6e 67 50 74 |ile (*bl|ankingPt|
|000014a0| 72 20 26 20 31 4c 29 3b | 20 2f 2a 20 6a 75 73 74 |r & 1L);| /* just|
|000014b0| 20 69 6e 20 63 61 73 65 | 20 77 65 27 72 65 20 69 | in case| we're i|
|000014c0| 6e 20 61 20 74 69 67 68 | 74 20 6c 6f 6f 70 2c 20 |n a tigh|t loop, |
|000014d0| 77 61 69 74 20 66 6f 72 | 20 65 6e 64 20 6f 66 20 |wait for| end of |
|000014e0| 62 6c 61 6e 6b 69 6e 67 | 20 2a 2f 0d 09 77 68 69 |blanking| */..whi|
|000014f0| 6c 65 20 28 21 28 2a 62 | 6c 61 6e 6b 69 6e 67 50 |le (!(*b|lankingP|
|00001500| 74 72 20 26 20 31 4c 29 | 29 3b 20 2f 2a 20 77 61 |tr & 1L)|); /* wa|
|00001510| 69 74 20 75 6e 74 69 6c | 20 62 65 67 69 6e 6e 69 |it until| beginni|
|00001520| 6e 67 20 6f 66 20 62 6c | 61 6e 6b 69 6e 67 20 69 |ng of bl|anking i|
|00001530| 6e 74 65 72 76 61 6c 20 | 2a 2f 0d 09 72 65 74 75 |nterval |*/..retu|
|00001540| 72 6e 3b 0d 7d 0d 0d 76 | 6f 69 64 20 4e 65 77 46 |rn;.}..v|oid NewF|
|00001550| 69 65 6c 64 54 46 42 28 | 69 6e 74 20 73 6c 6f 74 |ieldTFB(|int slot|
|00001560| 29 0d 2f 2a 20 4e 65 77 | 46 69 65 6c 64 54 46 42 |)./* New|FieldTFB|
|00001570| 20 77 61 69 74 73 20 66 | 6f 72 20 74 68 65 20 62 | waits f|or the b|
|00001580| 65 67 69 6e 6e 69 6e 67 | 20 6f 66 20 74 68 65 20 |eginning| of the |
|00001590| 6e 65 78 74 20 76 69 64 | 65 6f 20 66 69 65 6c 64 |next vid|eo field|
|000015a0| 20 2a 2f 0d 2f 2a 20 54 | 68 65 20 73 74 61 6e 64 | */./* T|he stand|
|000015b0| 61 72 64 20 41 70 70 6c | 65 20 76 69 64 65 6f 20 |ard Appl|e video |
|000015c0| 72 61 74 65 20 69 73 20 | 36 36 2e 36 37 20 48 7a |rate is |66.67 Hz|
|000015d0| 20 2a 2f 0d 7b 0d 09 72 | 65 67 69 73 74 65 72 20 | */.{..r|egister |
|000015e0| 6c 6f 6e 67 20 2a 62 6c | 61 6e 6b 69 6e 67 50 74 |long *bl|ankingPt|
|000015f0| 72 3b 0d 0d 09 69 66 28 | 21 54 46 42 49 6e 53 6c |r;...if(|!TFBInSl|
|00001600| 6f 74 28 73 6c 6f 74 29 | 29 7b 0d 09 09 70 72 69 |ot(slot)|){...pri|
|00001610| 6e 74 66 28 22 54 68 65 | 20 63 61 72 64 20 69 6e |ntf("The| card in|
|00001620| 20 73 6c 6f 74 20 25 64 | 20 69 73 20 6e 6f 74 20 | slot %d| is not |
|00001630| 61 20 54 46 42 20 63 61 | 72 64 21 5c 6e 22 2c 73 |a TFB ca|rd!\n",s|
|00001640| 6c 6f 74 29 3b 0d 09 09 | 72 65 74 75 72 6e 3b 0d |lot);...|return;.|
|00001650| 09 7d 0d 09 62 6c 61 6e | 6b 69 6e 67 50 74 72 20 |.}..blan|kingPtr |
|00001660| 3d 20 28 6c 6f 6e 67 20 | 2a 29 20 28 43 41 52 44 |= (long |*) (CARD|
|00001670| 42 41 53 45 28 73 6c 6f | 74 29 20 2b 20 52 65 61 |BASE(slo|t) + Rea|
|00001680| 64 56 53 79 6e 63 29 3b | 0d 09 77 68 69 6c 65 20 |dVSync);|..while |
|00001690| 28 21 28 2a 62 6c 61 6e | 6b 69 6e 67 50 74 72 20 |(!(*blan|kingPtr |
|000016a0| 26 20 31 4c 29 29 3b 09 | 2f 2a 20 77 61 69 74 20 |& 1L));.|/* wait |
|000016b0| 75 6e 74 69 6c 20 62 65 | 67 69 6e 6e 69 6e 67 20 |until be|ginning |
|000016c0| 6f 66 20 62 6c 61 6e 6b | 69 6e 67 20 69 6e 74 65 |of blank|ing inte|
|000016d0| 72 76 61 6c 20 2a 2f 0d | 09 77 68 69 6c 65 20 28 |rval */.|.while (|
|000016e0| 2a 62 6c 61 6e 6b 69 6e | 67 50 74 72 20 26 20 31 |*blankin|gPtr & 1|
|000016f0| 4c 29 3b 09 09 2f 2a 20 | 77 61 69 74 20 66 6f 72 |L);../* |wait for|
|00001700| 20 65 6e 64 20 6f 66 20 | 62 6c 61 6e 6b 69 6e 67 | end of |blanking|
|00001710| 20 2a 2f 0d 09 72 65 74 | 75 72 6e 3b 0d 7d 0d 0d | */..ret|urn;.}..|
|00001720| 69 6e 74 20 42 6c 61 6e | 6b 69 6e 67 54 46 42 28 |int Blan|kingTFB(|
|00001730| 69 6e 74 20 73 6c 6f 74 | 29 0d 2f 2a 20 72 65 74 |int slot|)./* ret|
|00001740| 75 72 6e 73 20 74 72 75 | 65 20 64 75 72 69 6e 67 |urns tru|e during|
|00001750| 20 74 68 65 20 62 6c 61 | 6e 6b 69 6e 67 20 69 6e | the bla|nking in|
|00001760| 74 65 72 76 61 6c 20 2a | 2f 0d 7b 0d 09 72 65 67 |terval *|/.{..reg|
|00001770| 69 73 74 65 72 20 6c 6f | 6e 67 20 2a 62 6c 61 6e |ister lo|ng *blan|
|00001780| 6b 69 6e 67 50 74 72 3b | 0d 0d 09 69 66 28 21 54 |kingPtr;|...if(!T|
|00001790| 46 42 49 6e 53 6c 6f 74 | 28 73 6c 6f 74 29 29 7b |FBInSlot|(slot)){|
|000017a0| 0d 09 09 70 72 69 6e 74 | 66 28 22 54 68 65 20 63 |...print|f("The c|
|000017b0| 61 72 64 20 69 6e 20 73 | 6c 6f 74 20 25 64 20 69 |ard in s|lot %d i|
|000017c0| 73 20 6e 6f 74 20 61 20 | 54 46 42 20 63 61 72 64 |s not a |TFB card|
|000017d0| 21 5c 6e 22 2c 73 6c 6f | 74 29 3b 0d 09 09 72 65 |!\n",slo|t);...re|
|000017e0| 74 75 72 6e 20 30 3b 0d | 09 7d 0d 09 62 6c 61 6e |turn 0;.|.}..blan|
|000017f0| 6b 69 6e 67 50 74 72 20 | 3d 20 28 6c 6f 6e 67 20 |kingPtr |= (long |
|00001800| 2a 29 20 28 43 41 52 44 | 42 41 53 45 28 73 6c 6f |*) (CARD|BASE(slo|
|00001810| 74 29 20 2b 20 52 65 61 | 64 56 53 79 6e 63 29 3b |t) + Rea|dVSync);|
|00001820| 0d 09 72 65 74 75 72 6e | 20 28 69 6e 74 29 20 28 |..return| (int) (|
|00001830| 2a 62 6c 61 6e 6b 69 6e | 67 50 74 72 20 26 20 31 |*blankin|gPtr & 1|
|00001840| 4c 29 3b 0d 7d 0d 0d 0d | 76 6f 69 64 20 53 65 74 |L);.}...|void Set|
|00001850| 44 65 70 74 68 54 46 42 | 28 69 6e 74 20 73 6c 6f |DepthTFB|(int slo|
|00001860| 74 2c 73 68 6f 72 74 20 | 62 69 74 73 29 0d 2f 2a |t,short |bits)./*|
|00001870| 20 73 65 74 73 20 75 70 | 20 74 68 65 20 76 69 64 | sets up| the vid|
|00001880| 65 6f 20 63 61 72 64 20 | 66 6f 72 20 74 68 65 20 |eo card |for the |
|00001890| 64 65 73 69 72 65 64 20 | 6e 75 6d 62 65 72 20 6f |desired |number o|
|000018a0| 66 20 62 69 74 73 2f 70 | 69 78 65 6c 3a 20 31 2c |f bits/p|ixel: 1,|
|000018b0| 20 32 2c 20 34 2c 20 6f | 72 20 38 20 2a 2f 0d 7b | 2, 4, o|r 8 */.{|
|000018c0| 0d 09 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 |..regist|er unsig|
|000018d0| 6e 65 64 20 63 68 61 72 | 20 2a 64 73 74 50 74 72 |ned char| *dstPtr|
|000018e0| 42 2c 20 2a 73 72 63 50 | 74 72 42 3b 0d 09 72 65 |B, *srcP|trB;..re|
|000018f0| 67 69 73 74 65 72 20 6c | 6f 6e 67 20 69 6e 74 20 |gister l|ong int |
|00001900| 69 3b 0d 09 73 68 6f 72 | 74 20 69 6e 74 20 6c 6f |i;..shor|t int lo|
|00001910| 67 32 62 69 74 73 3b 09 | 09 2f 2a 20 3d 20 6c 6f |g2bits;.|./* = lo|
|00001920| 67 32 28 62 69 74 73 29 | 20 2a 2f 0d 0d 09 69 66 |g2(bits)| */...if|
|00001930| 28 21 54 46 42 49 6e 53 | 6c 6f 74 28 73 6c 6f 74 |(!TFBInS|lot(slot|
|00001940| 29 29 7b 0d 09 09 70 72 | 69 6e 74 66 28 22 54 68 |)){...pr|intf("Th|
|00001950| 65 20 63 61 72 64 20 69 | 6e 20 73 6c 6f 74 20 25 |e card i|n slot %|
|00001960| 64 20 69 73 20 6e 6f 74 | 20 61 20 54 46 42 20 63 |d is not| a TFB c|
|00001970| 61 72 64 21 5c 6e 22 2c | 73 6c 6f 74 29 3b 0d 09 |ard!\n",|slot);..|
|00001980| 09 72 65 74 75 72 6e 3b | 0d 09 7d 0d 09 69 66 28 |.return;|..}..if(|
|00001990| 62 69 74 73 20 3e 20 38 | 29 20 72 65 74 75 72 6e |bits > 8|) return|
|000019a0| 3b 0d 09 6c 6f 67 32 62 | 69 74 73 20 3d 20 30 3b |;..log2b|its = 0;|
|000019b0| 0d 09 77 68 69 6c 65 20 | 28 20 28 62 69 74 73 20 |..while |( (bits |
|000019c0| 2f 3d 20 32 29 20 3e 20 | 30 20 29 20 6c 6f 67 32 |/= 2) > |0 ) log2|
|000019d0| 62 69 74 73 2b 2b 3b 0d | 09 64 73 74 50 74 72 42 |bits++;.|.dstPtrB|
|000019e0| 20 3d 20 28 43 41 52 44 | 42 41 53 45 28 73 6c 6f | = (CARD|BASE(slo|
|000019f0| 74 29 20 2b 20 54 46 42 | 42 61 73 65 29 3b 0d 09 |t) + TFB|Base);..|
|00001a00| 73 72 63 50 74 72 42 20 | 3d 20 26 28 54 46 42 52 |srcPtrB |= &(TFBR|
|00001a10| 65 67 69 73 74 65 72 56 | 61 6c 75 65 73 5b 6c 6f |egisterV|alues[lo|
|00001a20| 67 32 62 69 74 73 5d 5b | 30 5d 29 3b 09 0d 09 4e |g2bits][|0]);...N|
|00001a30| 65 77 46 69 65 6c 64 54 | 46 42 28 73 6c 6f 74 29 |ewFieldT|FB(slot)|
|00001a40| 3b 0d 09 2a 28 64 73 74 | 50 74 72 42 20 2b 20 31 |;..*(dst|PtrB + 1|
|00001a50| 35 2a 34 29 20 3d 20 28 | 63 68 61 72 29 20 30 78 |5*4) = (|char) 0x|
|00001a60| 42 37 3b 09 2f 2a 20 50 | 72 65 6c 6f 61 64 20 72 |B7;./* P|reload r|
|00001a70| 65 67 69 73 74 65 72 31 | 35 2e 20 50 75 74 20 74 |egister1|5. Put t|
|00001a80| 68 65 20 54 46 42 20 69 | 6e 74 6f 20 61 20 72 65 |he TFB i|nto a re|
|00001a90| 73 65 74 20 73 74 61 74 | 65 20 2a 2f 0d 09 2f 2a |set stat|e */../*|
|00001aa0| 20 30 78 42 37 20 61 70 | 70 61 72 65 6e 74 6c 79 | 0xB7 ap|parently|
|00001ab0| 20 72 65 71 75 65 73 74 | 73 20 69 6e 74 65 72 6c | request|s interl|
|00001ac0| 61 63 65 20 63 6c 6f 63 | 6b 20 6f 66 66 20 61 6e |ace cloc|k off an|
|00001ad0| 64 20 30 20 62 69 74 73 | 2f 70 69 78 65 6c 20 2a |d 0 bits|/pixel *|
|00001ae0| 2f 0d 09 66 6f 72 28 69 | 3d 31 35 3b 20 69 3e 3d |/..for(i|=15; i>=|
|00001af0| 30 3b 20 69 2d 2d 29 20 | 7b 0d 09 09 2a 64 73 74 |0; i--) |{...*dst|
|00001b00| 50 74 72 42 20 3d 20 7e | 20 2a 73 72 63 50 74 72 |PtrB = ~| *srcPtr|
|00001b10| 42 2b 2b 3b 0d 09 09 64 | 73 74 50 74 72 42 20 2b |B++;...d|stPtrB +|
|00001b20| 3d 20 34 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 3b |= 4;..}.|.return;|
|00001b30| 0d 7d 0d 0d 76 6f 69 64 | 20 53 79 6e 63 68 53 65 |.}..void| SynchSe|
|00001b40| 74 44 65 70 74 68 54 46 | 42 28 69 6e 74 20 6d 61 |tDepthTF|B(int ma|
|00001b50| 73 74 65 72 53 6c 6f 74 | 2c 69 6e 74 20 73 6c 6f |sterSlot|,int slo|
|00001b60| 74 2c 73 68 6f 72 74 20 | 62 69 74 73 29 0d 2f 2a |t,short |bits)./*|
|00001b70| 20 73 65 74 73 20 75 70 | 20 74 68 65 20 76 69 64 | sets up| the vid|
|00001b80| 65 6f 20 63 61 72 64 20 | 66 6f 72 20 74 68 65 20 |eo card |for the |
|00001b90| 64 65 73 69 72 65 64 20 | 6e 75 6d 62 65 72 20 6f |desired |number o|
|00001ba0| 66 20 62 69 74 73 2f 70 | 69 78 65 6c 3a 20 31 2c |f bits/p|ixel: 1,|
|00001bb0| 20 32 2c 20 34 2c 20 6f | 72 20 38 20 2a 2f 0d 7b | 2, 4, o|r 8 */.{|
|00001bc0| 0d 09 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 |..regist|er unsig|
|00001bd0| 6e 65 64 20 63 68 61 72 | 20 2a 64 73 74 50 74 72 |ned char| *dstPtr|
|00001be0| 42 2c 20 2a 73 72 63 50 | 74 72 42 3b 0d 09 72 65 |B, *srcP|trB;..re|
|00001bf0| 67 69 73 74 65 72 20 6c | 6f 6e 67 20 69 6e 74 20 |gister l|ong int |
|00001c00| 69 3b 0d 09 73 68 6f 72 | 74 20 69 6e 74 20 6c 6f |i;..shor|t int lo|
|00001c10| 67 32 62 69 74 73 3b 09 | 09 2f 2a 20 3d 20 6c 6f |g2bits;.|./* = lo|
|00001c20| 67 32 28 62 69 74 73 29 | 20 2a 2f 0d 0d 09 69 66 |g2(bits)| */...if|
|00001c30| 28 21 54 46 42 49 6e 53 | 6c 6f 74 28 73 6c 6f 74 |(!TFBInS|lot(slot|
|00001c40| 29 29 7b 0d 09 09 70 72 | 69 6e 74 66 28 22 54 68 |)){...pr|intf("Th|
|00001c50| 65 20 63 61 72 64 20 69 | 6e 20 73 6c 6f 74 20 25 |e card i|n slot %|
|00001c60| 64 20 69 73 20 6e 6f 74 | 20 61 20 54 46 42 20 63 |d is not| a TFB c|
|00001c70| 61 72 64 21 5c 6e 22 2c | 73 6c 6f 74 29 3b 0d 09 |ard!\n",|slot);..|
|00001c80| 09 72 65 74 75 72 6e 3b | 0d 09 7d 0d 09 69 66 28 |.return;|..}..if(|
|00001c90| 21 54 46 42 49 6e 53 6c | 6f 74 28 6d 61 73 74 65 |!TFBInSl|ot(maste|
|00001ca0| 72 53 6c 6f 74 29 29 7b | 0d 09 09 70 72 69 6e 74 |rSlot)){|...print|
|00001cb0| 66 28 22 54 68 65 20 63 | 61 72 64 20 69 6e 20 73 |f("The c|ard in s|
|00001cc0| 6c 6f 74 20 25 64 20 69 | 73 20 6e 6f 74 20 61 20 |lot %d i|s not a |
|00001cd0| 54 46 42 20 63 61 72 64 | 21 5c 6e 22 2c 6d 61 73 |TFB card|!\n",mas|
|00001ce0| 74 65 72 53 6c 6f 74 29 | 3b 0d 09 09 72 65 74 75 |terSlot)|;...retu|
|00001cf0| 72 6e 3b 0d 09 7d 0d 09 | 69 66 28 62 69 74 73 21 |rn;..}..|if(bits!|
|00001d00| 3d 31 20 26 26 20 62 69 | 74 73 21 3d 32 20 26 26 |=1 && bi|ts!=2 &&|
|00001d10| 20 62 69 74 73 21 3d 34 | 20 26 26 20 62 69 74 73 | bits!=4| && bits|
|00001d20| 21 3d 38 29 7b 0d 09 09 | 70 72 69 6e 74 66 28 22 |!=8){...|printf("|
|00001d30| 53 79 6e 63 68 53 65 74 | 44 65 70 74 68 54 46 42 |SynchSet|DepthTFB|
|00001d40| 3a 20 25 64 20 62 69 74 | 73 2f 70 69 78 65 6c 20 |: %d bit|s/pixel |
|00001d50| 69 6d 70 6f 73 73 69 62 | 6c 65 20 66 6f 72 20 61 |impossib|le for a|
|00001d60| 20 54 46 42 20 63 61 72 | 64 21 5c 6e 22 2c 62 69 | TFB car|d!\n",bi|
|00001d70| 74 73 29 3b 0d 09 09 72 | 65 74 75 72 6e 3b 0d 09 |ts);...r|eturn;..|
|00001d80| 7d 0d 09 6c 6f 67 32 62 | 69 74 73 20 3d 20 30 3b |}..log2b|its = 0;|
|00001d90| 0d 09 77 68 69 6c 65 20 | 28 20 28 62 69 74 73 20 |..while |( (bits |
|00001da0| 2f 3d 20 32 29 20 3e 20 | 30 20 29 20 6c 6f 67 32 |/= 2) > |0 ) log2|
|00001db0| 62 69 74 73 2b 2b 3b 0d | 09 64 73 74 50 74 72 42 |bits++;.|.dstPtrB|
|00001dc0| 20 3d 20 28 43 41 52 44 | 42 41 53 45 28 73 6c 6f | = (CARD|BASE(slo|
|00001dd0| 74 29 20 2b 20 54 46 42 | 42 61 73 65 29 3b 0d 09 |t) + TFB|Base);..|
|00001de0| 73 72 63 50 74 72 42 20 | 3d 20 26 28 54 46 42 52 |srcPtrB |= &(TFBR|
|00001df0| 65 67 69 73 74 65 72 56 | 61 6c 75 65 73 5b 6c 6f |egisterV|alues[lo|
|00001e00| 67 32 62 69 74 73 5d 5b | 30 5d 29 3b 09 0d 09 4e |g2bits][|0]);...N|
|00001e10| 65 77 46 69 65 6c 64 54 | 46 42 28 6d 61 73 74 65 |ewFieldT|FB(maste|
|00001e20| 72 53 6c 6f 74 29 3b 09 | 09 2f 2a 20 77 61 69 74 |rSlot);.|./* wait|
|00001e30| 20 66 6f 72 20 6d 61 73 | 74 65 72 53 6c 6f 74 20 | for mas|terSlot |
|00001e40| 65 6e 64 20 6f 66 20 66 | 72 61 6d 65 2a 2f 0d 09 |end of f|rame*/..|
|00001e50| 2a 28 64 73 74 50 74 72 | 42 20 2b 20 31 35 2a 34 |*(dstPtr|B + 15*4|
|00001e60| 29 20 3d 20 28 63 68 61 | 72 29 20 30 78 42 37 3b |) = (cha|r) 0xB7;|
|00001e70| 09 2f 2a 20 50 72 65 6c | 6f 61 64 20 72 65 67 69 |./* Prel|oad regi|
|00001e80| 73 74 65 72 31 35 2e 20 | 50 75 74 20 74 68 65 20 |ster15. |Put the |
|00001e90| 54 46 42 20 69 6e 74 6f | 20 61 20 72 65 73 65 74 |TFB into| a reset|
|00001ea0| 20 73 74 61 74 65 20 2a | 2f 0d 09 2f 2a 20 30 78 | state *|/../* 0x|
|00001eb0| 42 37 20 61 70 70 61 72 | 65 6e 74 6c 79 20 72 65 |B7 appar|ently re|
|00001ec0| 71 75 65 73 74 73 20 69 | 6e 74 65 72 6c 61 63 65 |quests i|nterlace|
|00001ed0| 20 63 6c 6f 63 6b 20 6f | 66 66 20 61 6e 64 20 30 | clock o|ff and 0|
|00001ee0| 20 62 69 74 73 2f 70 69 | 78 65 6c 20 2a 2f 0d 09 | bits/pi|xel */..|
|00001ef0| 66 6f 72 28 69 3d 31 35 | 3b 20 69 3e 3d 30 3b 20 |for(i=15|; i>=0; |
|00001f00| 69 2d 2d 29 20 7b 0d 09 | 09 2a 64 73 74 50 74 72 |i--) {..|.*dstPtr|
|00001f10| 42 20 3d 20 7e 20 2a 73 | 72 63 50 74 72 42 2b 2b |B = ~ *s|rcPtrB++|
|00001f20| 3b 0d 09 09 64 73 74 50 | 74 72 42 20 2b 3d 20 34 |;...dstP|trB += 4|
|00001f30| 3b 0d 09 7d 0d 09 72 65 | 74 75 72 6e 3b 0d 7d 0d |;..}..re|turn;.}.|
|00001f40| 0d 76 6f 69 64 20 53 79 | 6e 63 68 54 6f 4d 61 69 |.void Sy|nchToMai|
|00001f50| 6e 44 65 76 69 63 65 54 | 46 42 28 64 65 76 69 63 |nDeviceT|FB(devic|
|00001f60| 65 29 0d 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |e).GDHan|dle devi|
|00001f70| 63 65 3b 0d 7b 0d 09 53 | 79 6e 63 68 53 65 74 44 |ce;.{..S|ynchSetD|
|00001f80| 65 70 74 68 54 46 42 28 | 47 65 74 44 65 76 69 63 |epthTFB(|GetDevic|
|00001f90| 65 53 6c 6f 74 28 47 65 | 74 4d 61 69 6e 44 65 76 |eSlot(Ge|tMainDev|
|00001fa0| 69 63 65 28 29 29 2c 47 | 65 74 44 65 76 69 63 65 |ice()),G|etDevice|
|00001fb0| 53 6c 6f 74 28 64 65 76 | 69 63 65 29 2c 20 28 2a |Slot(dev|ice), (*|
|00001fc0| 2a 28 2a 2a 64 65 76 69 | 63 65 29 2e 67 64 50 4d |*(**devi|ce).gdPM|
|00001fd0| 61 70 29 2e 70 69 78 65 | 6c 53 69 7a 65 29 3b 0d |ap).pixe|lSize);.|
|00001fe0| 7d 0d 0d 76 6f 69 64 20 | 48 61 6c 74 54 46 42 28 |}..void |HaltTFB(|
|00001ff0| 69 6e 74 20 73 6c 6f 74 | 29 0d 7b 0d 09 72 65 67 |int slot|).{..reg|
|00002000| 69 73 74 65 72 20 75 6e | 73 69 67 6e 65 64 20 63 |ister un|signed c|
|00002010| 68 61 72 20 2a 64 73 74 | 50 74 72 42 3b 0d 0d 09 |har *dst|PtrB;...|
|00002020| 69 66 28 21 54 46 42 49 | 6e 53 6c 6f 74 28 73 6c |if(!TFBI|nSlot(sl|
|00002030| 6f 74 29 29 7b 0d 09 09 | 70 72 69 6e 74 66 28 22 |ot)){...|printf("|
|00002040| 54 68 65 20 63 61 72 64 | 20 69 6e 20 73 6c 6f 74 |The card| in slot|
|00002050| 20 25 64 20 69 73 20 6e | 6f 74 20 61 20 54 46 42 | %d is n|ot a TFB|
|00002060| 20 63 61 72 64 21 5c 6e | 22 2c 73 6c 6f 74 29 3b | card!\n|",slot);|
|00002070| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 7d 0d 09 64 |...retur|n;..}..d|
|00002080| 73 74 50 74 72 42 20 3d | 20 28 43 41 52 44 42 41 |stPtrB =| (CARDBA|
|00002090| 53 45 28 73 6c 6f 74 29 | 20 2b 20 54 46 42 42 61 |SE(slot)| + TFBBa|
|000020a0| 73 65 29 3b 0d 09 4e 65 | 77 46 69 65 6c 64 54 46 |se);..Ne|wFieldTF|
|000020b0| 42 28 73 6c 6f 74 29 3b | 0d 09 2a 28 64 73 74 50 |B(slot);|..*(dstP|
|000020c0| 74 72 42 20 2b 20 31 35 | 2a 34 29 20 3d 20 28 63 |trB + 15|*4) = (c|
|000020d0| 68 61 72 29 20 30 78 42 | 37 3b 09 2f 2a 20 50 72 |har) 0xB|7;./* Pr|
|000020e0| 65 6c 6f 61 64 20 72 65 | 67 69 73 74 65 72 31 35 |eload re|gister15|
|000020f0| 2e 20 50 75 74 20 74 68 | 65 20 54 46 42 20 69 6e |. Put th|e TFB in|
|00002100| 74 6f 20 61 20 72 65 73 | 65 74 20 73 74 61 74 65 |to a res|et state|
|00002110| 20 2a 2f 0d 09 2f 2a 20 | 30 78 42 37 20 61 70 70 | */../* |0xB7 app|
|00002120| 61 72 65 6e 74 6c 79 20 | 72 65 71 75 65 73 74 73 |arently |requests|
|00002130| 20 69 6e 74 65 72 6c 61 | 63 65 20 63 6c 6f 63 6b | interla|ce clock|
|00002140| 20 6f 66 66 20 61 6e 64 | 20 30 20 62 69 74 73 2f | off and| 0 bits/|
|00002150| 70 69 78 65 6c 20 2a 2f | 0d 7d 0d 0d 76 6f 69 64 |pixel */|.}..void|
|00002160| 20 52 65 73 74 61 72 74 | 54 46 42 28 69 6e 74 20 | Restart|TFB(int |
|00002170| 73 6c 6f 74 2c 73 68 6f | 72 74 20 62 69 74 73 29 |slot,sho|rt bits)|
|00002180| 0d 7b 0d 09 72 65 67 69 | 73 74 65 72 20 75 6e 73 |.{..regi|ster uns|
|00002190| 69 67 6e 65 64 20 63 68 | 61 72 20 2a 64 73 74 50 |igned ch|ar *dstP|
|000021a0| 74 72 42 2c 20 2a 73 72 | 63 50 74 72 42 3b 0d 09 |trB, *sr|cPtrB;..|
|000021b0| 72 65 67 69 73 74 65 72 | 20 6c 6f 6e 67 20 69 6e |register| long in|
|000021c0| 74 20 69 3b 0d 09 73 68 | 6f 72 74 20 69 6e 74 20 |t i;..sh|ort int |
|000021d0| 6c 6f 67 32 62 69 74 73 | 3b 09 09 2f 2a 20 3d 20 |log2bits|;../* = |
|000021e0| 6c 6f 67 32 28 62 69 74 | 73 29 20 2a 2f 0d 0d 09 |log2(bit|s) */...|
|000021f0| 69 66 28 21 54 46 42 49 | 6e 53 6c 6f 74 28 73 6c |if(!TFBI|nSlot(sl|
|00002200| 6f 74 29 29 7b 0d 09 09 | 70 72 69 6e 74 66 28 22 |ot)){...|printf("|
|00002210| 54 68 65 20 63 61 72 64 | 20 69 6e 20 73 6c 6f 74 |The card| in slot|
|00002220| 20 25 64 20 69 73 20 6e | 6f 74 20 61 20 54 46 42 | %d is n|ot a TFB|
|00002230| 20 63 61 72 64 21 5c 6e | 22 2c 73 6c 6f 74 29 3b | card!\n|",slot);|
|00002240| 0d 09 09 72 65 74 75 72 | 6e 3b 0d 09 7d 0d 09 69 |...retur|n;..}..i|
|00002250| 66 28 62 69 74 73 20 3e | 20 38 29 20 72 65 74 75 |f(bits >| 8) retu|
|00002260| 72 6e 3b 0d 09 6c 6f 67 | 32 62 69 74 73 20 3d 20 |rn;..log|2bits = |
|00002270| 30 3b 0d 09 77 68 69 6c | 65 20 28 20 28 62 69 74 |0;..whil|e ( (bit|
|00002280| 73 20 2f 3d 20 32 29 20 | 3e 20 30 20 29 20 6c 6f |s /= 2) |> 0 ) lo|
|00002290| 67 32 62 69 74 73 2b 2b | 3b 0d 09 64 73 74 50 74 |g2bits++|;..dstPt|
|000022a0| 72 42 20 3d 20 28 43 41 | 52 44 42 41 53 45 28 73 |rB = (CA|RDBASE(s|
|000022b0| 6c 6f 74 29 20 2b 20 54 | 46 42 42 61 73 65 29 3b |lot) + T|FBBase);|
|000022c0| 0d 09 73 72 63 50 74 72 | 42 20 3d 20 26 28 54 46 |..srcPtr|B = &(TF|
|000022d0| 42 52 65 67 69 73 74 65 | 72 56 61 6c 75 65 73 5b |BRegiste|rValues[|
|000022e0| 6c 6f 67 32 62 69 74 73 | 5d 5b 30 5d 29 3b 09 0d |log2bits|][0]);..|
|000022f0| 09 2a 28 64 73 74 50 74 | 72 42 20 2b 20 31 35 2a |.*(dstPt|rB + 15*|
|00002300| 34 29 20 3d 20 28 63 68 | 61 72 29 20 30 78 42 37 |4) = (ch|ar) 0xB7|
|00002310| 3b 09 2f 2a 20 50 72 65 | 6c 6f 61 64 20 72 65 67 |;./* Pre|load reg|
|00002320| 69 73 74 65 72 31 35 2e | 20 50 75 74 20 74 68 65 |ister15.| Put the|
|00002330| 20 54 46 42 20 69 6e 74 | 6f 20 61 20 72 65 73 65 | TFB int|o a rese|
|00002340| 74 20 73 74 61 74 65 20 | 2a 2f 0d 09 2f 2a 20 30 |t state |*/../* 0|
|00002350| 78 42 37 20 61 70 70 61 | 72 65 6e 74 6c 79 20 72 |xB7 appa|rently r|
|00002360| 65 71 75 65 73 74 73 20 | 69 6e 74 65 72 6c 61 63 |equests |interlac|
|00002370| 65 20 63 6c 6f 63 6b 20 | 6f 66 66 20 61 6e 64 20 |e clock |off and |
|00002380| 30 20 62 69 74 73 2f 70 | 69 78 65 6c 20 2a 2f 0d |0 bits/p|ixel */.|
|00002390| 09 66 6f 72 28 69 3d 31 | 35 3b 20 69 3e 3d 30 3b |.for(i=1|5; i>=0;|
|000023a0| 20 69 2d 2d 29 20 7b 0d | 09 09 2a 64 73 74 50 74 | i--) {.|..*dstPt|
|000023b0| 72 42 20 3d 20 7e 20 2a | 73 72 63 50 74 72 42 2b |rB = ~ *|srcPtrB+|
|000023c0| 2b 3b 0d 09 09 64 73 74 | 50 74 72 42 20 2b 3d 20 |+;...dst|PtrB += |
|000023d0| 34 3b 0d 09 7d 0d 09 72 | 65 74 75 72 6e 3b 0d 7d |4;..}..r|eturn;.}|
|000023e0| 0d 0d 76 6f 69 64 20 48 | 61 6c 74 44 65 76 69 63 |..void H|altDevic|
|000023f0| 65 54 46 42 28 64 65 76 | 69 63 65 29 0d 47 44 48 |eTFB(dev|ice).GDH|
|00002400| 61 6e 64 6c 65 20 64 65 | 76 69 63 65 3b 0d 7b 0d |andle de|vice;.{.|
|00002410| 09 48 61 6c 74 54 46 42 | 28 47 65 74 44 65 76 69 |.HaltTFB|(GetDevi|
|00002420| 63 65 53 6c 6f 74 28 64 | 65 76 69 63 65 29 29 3b |ceSlot(d|evice));|
|00002430| 0d 7d 0d 0d 76 6f 69 64 | 20 52 65 73 74 61 72 74 |.}..void| Restart|
|00002440| 44 65 76 69 63 65 54 46 | 42 28 64 65 76 69 63 65 |DeviceTF|B(device|
|00002450| 29 0d 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |).GDHand|le devic|
|00002460| 65 3b 0d 7b 0d 09 52 65 | 73 74 61 72 74 54 46 42 |e;.{..Re|startTFB|
|00002470| 28 47 65 74 44 65 76 69 | 63 65 53 6c 6f 74 28 64 |(GetDevi|ceSlot(d|
|00002480| 65 76 69 63 65 29 2c 20 | 28 2a 2a 28 2a 2a 64 65 |evice), |(**(**de|
|00002490| 76 69 63 65 29 2e 67 64 | 50 4d 61 70 29 2e 70 69 |vice).gd|PMap).pi|
|000024a0| 78 65 6c 53 69 7a 65 29 | 3b 0d 7d 0d 0d 76 6f 69 |xelSize)|;.}..voi|
|000024b0| 64 20 53 63 72 6f 6c 6c | 54 46 42 28 69 6e 74 20 |d Scroll|TFB(int |
|000024c0| 73 6c 6f 74 2c 73 68 6f | 72 74 20 62 69 74 73 2c |slot,sho|rt bits,|
|000024d0| 6c 6f 6e 67 20 78 2c 6c | 6f 6e 67 20 79 29 0d 7b |long x,l|ong y).{|
|000024e0| 0d 09 72 65 67 69 73 74 | 65 72 20 75 6e 73 69 67 |..regist|er unsig|
|000024f0| 6e 65 64 20 63 68 61 72 | 20 2a 73 72 63 50 74 72 |ned char| *srcPtr|
|00002500| 42 3b 0d 09 6c 6f 6e 67 | 20 69 6e 74 20 73 2c 20 |B;..long| int s, |
|00002510| 52 6f 77 42 79 74 65 73 | 3b 0d 0d 09 69 66 28 21 |RowBytes|;...if(!|
|00002520| 54 46 42 49 6e 53 6c 6f | 74 28 73 6c 6f 74 29 29 |TFBInSlo|t(slot))|
|00002530| 7b 0d 09 09 70 72 69 6e | 74 66 28 22 54 68 65 20 |{...prin|tf("The |
|00002540| 63 61 72 64 20 69 6e 20 | 73 6c 6f 74 20 25 64 20 |card in |slot %d |
|00002550| 69 73 20 6e 6f 74 20 61 | 20 54 46 42 20 63 61 72 |is not a| TFB car|
|00002560| 64 21 5c 6e 22 2c 73 6c | 6f 74 29 3b 0d 09 09 72 |d!\n",sl|ot);...r|
|00002570| 65 74 75 72 6e 3b 0d 09 | 7d 0d 09 52 6f 77 42 79 |eturn;..|}..RowBy|
|00002580| 74 65 73 20 3d 20 31 30 | 32 34 2a 62 69 74 73 2f |tes = 10|24*bits/|
|00002590| 38 3b 0d 09 73 20 3d 20 | 33 32 20 2b 20 78 20 2b |8;..s = |32 + x +|
|000025a0| 20 52 6f 77 42 79 74 65 | 73 2a 79 3b 0d 09 73 20 | RowByte|s*y;..s |
|000025b0| 2f 3d 20 34 3b 09 09 09 | 2f 2a 20 55 6e 66 6f 72 |/= 4;...|/* Unfor|
|000025c0| 74 75 6e 61 74 65 6c 79 | 20 74 68 65 20 42 61 73 |tunately| the Bas|
|000025d0| 65 20 41 64 64 72 65 73 | 73 20 69 73 20 73 70 65 |e Addres|s is spe|
|000025e0| 63 69 66 69 65 64 20 69 | 6e 20 34 20 62 79 74 65 |cified i|n 4 byte|
|000025f0| 20 77 6f 72 64 73 20 2a | 2f 0d 09 73 72 63 50 74 | words *|/..srcPt|
|00002600| 72 42 20 3d 20 43 41 52 | 44 42 41 53 45 28 73 6c |rB = CAR|DBASE(sl|
|00002610| 6f 74 29 20 2b 20 54 46 | 42 42 61 73 65 3b 0d 09 |ot) + TF|BBase;..|
|00002620| 2a 28 73 72 63 50 74 72 | 42 20 2b 20 33 2a 34 29 |*(srcPtr|B + 3*4)|
|00002630| 20 3d 20 7e 20 73 25 32 | 35 36 3b 0d 09 73 20 2f | = ~ s%2|56;..s /|
|00002640| 3d 20 32 35 36 3b 0d 09 | 2a 28 73 72 63 50 74 72 |= 256;..|*(srcPtr|
|00002650| 42 20 2b 20 32 2a 34 29 | 20 3d 20 7e 20 73 25 32 |B + 2*4)| = ~ s%2|
|00002660| 35 36 3b 0d 2f 2a 0d 09 | 73 20 2f 3d 20 32 35 36 |56;./*..|s /= 256|
|00002670| 3b 0d 09 2a 28 73 72 63 | 50 74 72 42 20 2b 20 31 |;..*(src|PtrB + 1|
|00002680| 35 2a 34 29 20 3d 20 7e | 20 28 34 2a 28 73 25 32 |5*4) = ~| (4*(s%2|
|00002690| 29 20 2b 20 54 46 42 52 | 65 67 69 73 74 65 72 56 |) + TFBR|egisterV|
|000026a0| 61 6c 75 65 73 5b 33 5d | 5b 31 35 5d 29 3b 0d 2a |alues[3]|[15]);.*|
|000026b0| 2f 0d 7d 0d 0d 76 6f 69 | 64 20 50 61 6e 54 46 42 |/.}..voi|d PanTFB|
|000026c0| 28 69 6e 74 20 73 6c 6f | 74 2c 6c 6f 6e 67 20 69 |(int slo|t,long i|
|000026d0| 6e 74 20 78 29 0d 2f 2a | 0d 50 61 6e 54 46 42 28 |nt x)./*|.PanTFB(|
|000026e0| 29 20 70 61 6e 73 20 74 | 68 65 20 64 69 73 70 6c |) pans t|he displ|
|000026f0| 61 79 20 68 6f 72 69 7a | 6f 6e 74 61 6c 6c 79 2e |ay horiz|ontally.|
|00002700| 0d 78 20 69 73 20 74 68 | 65 20 64 65 73 69 72 65 |.x is th|e desire|
|00002710| 64 20 73 74 61 72 74 69 | 6e 67 20 70 6f 69 6e 74 |d starti|ng point|
|00002720| 20 69 6e 20 6d 65 6d 6f | 72 79 2c 20 69 6e 20 62 | in memo|ry, in b|
|00002730| 79 74 65 73 2e 20 0d 46 | 6f 72 20 73 69 6d 70 6c |ytes. .F|or simpl|
|00002740| 69 63 69 74 79 20 49 20 | 61 73 73 75 6d 65 20 74 |icity I |assume t|
|00002750| 68 61 74 20 74 68 65 20 | 76 65 72 74 69 63 61 6c |hat the |vertical|
|00002760| 20 73 63 72 6f 6c 6c 20 | 69 73 20 7a 65 72 6f 2e | scroll |is zero.|
|00002770| 0d 2a 2f 0d 7b 0d 09 72 | 65 67 69 73 74 65 72 20 |.*/.{..r|egister |
|00002780| 75 6e 73 69 67 6e 65 64 | 20 63 68 61 72 20 2a 73 |unsigned| char *s|
|00002790| 72 63 50 74 72 42 3b 0d | 0d 09 69 66 28 21 54 46 |rcPtrB;.|..if(!TF|
|000027a0| 42 49 6e 53 6c 6f 74 28 | 73 6c 6f 74 29 29 7b 0d |BInSlot(|slot)){.|
|000027b0| 09 09 70 72 69 6e 74 66 | 28 22 54 68 65 20 63 61 |..printf|("The ca|
|000027c0| 72 64 20 69 6e 20 73 6c | 6f 74 20 25 64 20 69 73 |rd in sl|ot %d is|
|000027d0| 20 6e 6f 74 20 61 20 54 | 46 42 20 63 61 72 64 21 | not a T|FB card!|
|000027e0| 5c 6e 22 2c 73 6c 6f 74 | 29 3b 0d 09 09 72 65 74 |\n",slot|);...ret|
|000027f0| 75 72 6e 3b 0d 09 7d 0d | 09 78 20 2f 3d 20 34 3b |urn;..}.|.x /= 4;|
|00002800| 09 09 09 2f 2a 20 55 6e | 66 6f 72 74 75 6e 61 74 |.../* Un|fortunat|
|00002810| 65 6c 79 20 74 68 65 20 | 42 61 73 65 20 41 64 64 |ely the |Base Add|
|00002820| 72 65 73 73 20 69 73 20 | 73 70 65 63 69 66 69 65 |ress is |specifie|
|00002830| 64 20 69 6e 20 34 20 62 | 79 74 65 20 77 6f 72 64 |d in 4 b|yte word|
|00002840| 73 20 2a 2f 0d 09 78 20 | 2b 3d 20 38 3b 09 09 09 |s */..x |+= 8;...|
|00002850| 2f 2a 20 41 70 70 6c 65 | 27 73 20 6f 72 69 67 69 |/* Apple|'s origi|
|00002860| 6e 20 2a 2f 0d 09 73 72 | 63 50 74 72 42 20 3d 20 |n */..sr|cPtrB = |
|00002870| 43 41 52 44 42 41 53 45 | 28 73 6c 6f 74 29 20 2b |CARDBASE|(slot) +|
|00002880| 20 54 46 42 50 61 6e 3b | 0d 09 2a 73 72 63 50 74 | TFBPan;|..*srcPt|
|00002890| 72 42 20 3d 20 7e 20 78 | 3b 0d 09 72 65 74 75 72 |rB = ~ x|;..retur|
|000028a0| 6e 3b 0d 7d 0d 0d 00 00 | 00 00 00 00 00 00 00 00 |n;.}....|........|
|000028b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000028f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002900| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00002910| 6e 65 72 61 6c 20 70 75 | 72 70 6f 73 65 20 76 69 |neral pu|rpose vi|
|00002920| 64 65 6f 20 72 6f 75 74 | 69 6e 65 73 20 62 61 73 |deo rout|ines bas|
|00002930| 0a 56 69 64 65 6f 54 46 | 42 2e 63 6f 02 00 00 00 |.VideoTF|B.co....|
|00002940| 54 45 58 54 4b 41 48 4c | 00 00 00 00 00 00 00 00 |TEXTKAHL|........|
|00002950| 00 00 54 45 58 54 4b 41 | 48 4c 00 00 00 00 00 00 |..TEXTKA|HL......|
|00002960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002970| 00 00 a7 e5 d5 d3 00 00 | 00 00 00 00 01 ac 73 74 |........|......st|
|00002980| 69 63 73 20 49 20 72 65 | 63 65 69 76 65 64 20 66 |ics I re|ceived f|
|00002990| 72 6f 6d 20 54 6f 62 79 | 20 46 61 72 72 61 6e 64 |rom Toby| Farrand|
|000029a0| 2e 0d 31 30 2f 32 39 2f | 38 38 20 64 67 70 0d 2a |..10/29/|88 dgp.*|
|000029b0| 2f 0d 0d 0d 2f 2a 20 54 | 68 65 20 43 61 72 64 42 |/.../* T|he CardB|
|000029c0| 61 73 65 20 61 64 64 72 | 65 73 73 20 64 65 70 65 |ase addr|ess depe|
|000029d0| 6e 64 73 20 6f 6e 20 77 | 68 69 63 68 20 73 6c 6f |nds on w|hich slo|
|000029e0| 74 20 74 68 65 20 63 61 | 72 64 20 69 73 20 70 6c |t the ca|rd is pl|
|000029f0| 75 67 67 65 64 20 69 6e | 74 6f 20 2a 2f 0d 2f 2a |ugged in|to */./*|
|00002a00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 20 74 68 |...H..Mo|naco. th|
|00002a10| 6f 73 65 20 74 68 61 74 | 20 61 70 70 65 61 72 20 |ose that| appear |
|00002a20| 69 6e 20 74 68 65 00 06 | 00 04 00 3c 00 24 01 dd |in the..|...<.$..|
|00002a30| 02 3d 00 3c 00 24 01 dd | 02 3d a7 af 30 1d 00 00 |.=.<.$..|.=..0...|
|00002a40| 24 2d 00 00 24 6f 00 00 | 23 b4 01 00 00 00 00 1e |$-..$o..|#.......|
|00002a50| 00 3c 00 24 01 dd 02 3d | 00 3c 00 24 01 dd 02 3d |.<.$...=|.<.$...=|
|00002a60| 00 00 23 b4 00 00 00 00 | 00 00 00 00 00 00 00 00 |..#.....|........|
|00002a70| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 a9 |.....n..|.n...>..|
|00002a80| e6 bc 09 8e 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |........|.>..MPSR|
|00002a90| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00002aa0| 03 f0 ff ff 00 00 00 4c | 00 ab e5 94 00 00 00 00 |.......L|........|
|00002ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+